package jee.boot.module.act.rest;

import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.entity.activiti.ActExecution;
import jee.boot.entity.activiti.ActTask;
import jee.boot.module.act.service.ActExecutionService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模型服务接口
 *
 * @author
 * @version 2019-01-30
 */
@RestController
@RequestMapping(value = "/execution")
public class ActExecutionRestController extends CrudController<ActExecutionService, ActExecution> {

    /**
     * 启动任务
     * @param entity
     * @return
     */
    @PostMapping("/start")
    public ResponseMessage<ActExecution> start(@RequestBody ActExecution entity) {
        entity = service.start(entity);
        return Result.success(entity);
    }

}
